package com.foreknow.service.impl;

import com.foreknow.dao.DiseaseMapper;
import com.foreknow.entity.Disease;
import com.foreknow.service.DiseaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.xml.ws.Action;
import java.util.List;
@Service
public class DiseaseServiceImpl implements DiseaseService {
    @Autowired
    private DiseaseMapper diseaseMapper;
    @Override
    public List<Disease> selectDiseaseList(Integer DiseCategoryID) {
        List<Disease> list= diseaseMapper.selectDiseaseList(DiseCategoryID);
        return list;

    }

    /**
     * 添加疾病种类
     * @param record
     * @return
     */
    @Override
    public int insertSelective(Disease record) {
        return diseaseMapper.insertSelective(record);
    }

    /**
     * 模糊查询
     * @param disease
     * @return
     */
    @Override
    public List<Disease> selectDiseaseByDisease(Disease disease) {
        return diseaseMapper.selectDiseaseByDisease(disease);
    }
    /**
     * 根据疾病名字查询疾病的所有信息
     * @param diseasename
     * @return
     */
    @Override
    public Disease selectDisease(String diseasename) {
        return diseaseMapper.selectDisease(diseasename);
    }

    /**
     * 对疾病的信息进行修改完善
     * @param record
     * @return
     */

    @Override
    public int updateByPrimaryKeySelective(Disease record) {

        return diseaseMapper.updateByPrimaryKeySelective(record);
    }
    /**
     * 根据 id 进行逻辑删除
     * @param id
     * @return
     */

    @Override
    public int deleteDisease(Integer id) {
        return diseaseMapper.deleteDisease(id);
    }


}
